Show linked object with DXL

Hello, 
suppose that you have two formal modules like the ones below 

Man module 
ID  Object Heading
 
1   Tom (has an incoming link FROM Eleonor) 
2   Paul (has an incoming link FROM Sasha and Margaret) 

Girl module 
ID Object Heading 

1 Eleonor (has an outgoing  link TO Tom) 
2 Sasha    (has an outgoing link to Paul) 
3 Margaret (has an outgoing link to Paul) 
I would like to print with a DXL script the couple "pointed object and pointing object" such as: 
Tom, Eleonor 
Paul, Sasha 
Paul, Margaret 
I've tried out with side1 and side2 commands of the linkset object, but I can 
display only the first row: 
Tom, Eleonor 
How can I print all the rows? 
Thank you in advance. 
Domenico


domenicodl - Sun Jul 07 17:26:54 EDT 2013

Re: Show linked object with DXL
Mike.Scharnow - Sun Jul 07 17:56:40 EDT 2013

Object o
Module mSource = read ("/myproject/girl", false, false)
if (null mSource) then error "something's wrong"
 
for o in entire mSource do {
if isDeleted (o) then continue
Link l
 
for l in all o->"*" do {
ModuleVersion mv = targetVersion (l)
if (null data mv) {
Module mTarget = load (mv, false)
if (null mTarget) then error "some other thing's wrong"
}
delete mv
 
string wife = o."Object Text" ""
string husband = (target l)."Object Text" ""
print husband ", " wife "\n"
}
}

 

Re: Show linked object with DXL
Mike.Scharnow - Sun Jul 07 18:03:34 EDT 2013

Link sets are definitions used to evaluate "which module has link to which other module".

Look up "Links" and "Versioned Links" in the DXL help

Re: Show linked object with DXL
llandale - Mon Jul 08 15:52:26 EDT 2013

Mike's post looks good.  I note however it is from the perspective of the "girl" module.  I think it would be a bit clearer if you changed the "husband" line to this:

  • Object oOther = target l    // handle of object at the other end of the link
  • string husband = oOther."Object Text" ""

"side1" and "side2"!!??  In all my years here nobody has EVERY posted anything about that!  Those functions designed to be used by DXL when viewing a link-module.  You can select something in the hopeless spread sheet and use DXL to get a handle on the pair of objects; one along the top the other along the side.  That interface is hopeless and you should forget about it.  There is very little you need to care about when dealing with a "Link Module" handle.

-Louie